<template>
  <div>
    <div class="qrBox">
      <h4>jquery二维码插件</h4>
      <div>输入10k以内个字符都能正常绘制图片</div>
      <input type="text" v-model="txt" class="qrcTxt">
      <button @click="start">刷新</button>
      <div id="qrcode" class="qrb"></div>
    </div>
  </div>
</template>

<script>
  import myQrcode from './qrcode'
  // import qrcode from './jquery.qrcode.min.js'
  // import jQuery from './jquery.js'
  export default {
    name: "Qrcode",
    data(){
      return {
        txt:'https://loolife.gitee.io/cubefish',
        key:'HTTPS://NP.JMHD8.COM/JWMP/',
        str:'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ',
        test:"a"
      }
    },
    methods:{
      start(){
        document.getElementById("qrcode").innerHTML='';
        myQrcode('#qrcode',this.txt);
      }
    },
    mounted() {
      this.start();
    }
  }
</script>

<style scoped>
.qrcTxt{
  width: 380px;
}
  .qrBox{
    max-width: 427px;
    margin:0px auto;
  }
  .qrb{
    width: 256px;
    height: 256px;
    margin: 0 auto;
  }
</style>
